import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);


const store = new Vuex.Store({
	state:{ //相当于一个存储空间
		chatUserInfo: {
			isLogin: false,
			username: '',
			account: '',
		},
		showUserInfoRight: {
			isFriend: false,
			remarksName: '',
			username: '',
			account: '',
			timeToBeFriend: '',
		},
		chackChatUser: {
			remarksName: '',
			username: '',
			account: '',
		},
		chackRightArea: '',
	},
	getters:{}, //state的计算数据 实现数据过滤的作用（get）
	mutations:{ //设置state中的数据（set）
		setChatUserInfo(state, data){
				state.chatUserInfo = data
		},
		setShowUserInfoRight(state, data){
			state.showUserInfoRight = data
		},
		setChackChatUser(state, data){
			state.chackChatUser = data
		},
		setChackRightArea(state, data){
			state.chackRightArea = data
		},
	},
	actions:{},  //可以发送异步请求
	modules:{},  //拆分存储空间模块化

})
//导出store对象
export default store
